<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/9
 * Time: 19:14
 */

namespace app\admin\Logic;


use Think\Cache\Driver\Db;
use think\model\Merge;

class SpecificationLogic extends Merge
{
    /**
     * 获取 tp_spec_item表 指定规格id的 规格项
     * @param int $spec_id 规格id
     * @return array 返回数组
     */
    public function getSpecItem($spec_id)
    {
        $arr = Db('commodity_item')->where("spec_id",$spec_id)->order('id')->select();
        $arr = get_id_val($arr, 'id','item');
        return $arr;
    }
}